import { test, expect } from "vitest";

import { getPineconeClient } from "../client.js";

test("confirm getPineconeClient throws error when PINECONE_API_KEY is not set", async () => {
  process.env.PINECONE_API_KEY = "";
  const errorThrown = async () => {
    getPineconeClient();
  };
  await expect(errorThrown).rejects.toThrow(Error);
  await expect(errorThrown).rejects.toThrow(
    "PINECONE_API_KEY must be set in environment"
  );
});
